
**************************************************************************************
**************************************************************************************
*********************************** FOOTNOTE 22 **************************************
**************************************************************************************
**************************************************************************************

* NOTE: All file paths and data names that need to be inserted are identified with <>

clear
set more off
capture log close  

cd "<insert file path>/7_chetty_etal" 

log using "chetty_estimates.log", replace

di "Time $S_DATE $S_TIME"

* This is downloaded from https://opportunityinsights.org/paper/lifeexpectancy/
import delimited "health_ineq_online_table_15.csv", clear

keep if age_at_d<60

* Change to household income per 1000
gen hh_inc000=hh_inc/1000

* Marginal changes for different groups in footnote
reg mortrate i.yod i.age_at_d hh_inc000 [aw=count] if pctile<=3

reg mortrate i.yod i.age_at_d hh_inc000 [aw=count] if pctile<=5

reg mortrate i.yod i.age_at_d hh_inc000 [aw=count] if pctile<=10

reg mortrate i.yod i.age_at_d hh_inc000 [aw=count] if pctile<=30

reg mortrate i.yod i.age_at_d hh_inc000 [aw=count] if pctile<=50

* Summary statistics at lowest percentile - used to scale marginal changes
summ mortrate if pctile==1 [aw=count]

clear all

log close